/*
 * Exercise_2_3_5.h
 *
 *  Created on: 11 déc. 2011
 *      Author: M. Alexandre (malexand314@gmail.com)
 */

#ifndef EXERCISE_2_3_5_H_
#define EXERCISE_2_3_5_H_

#include "../Exercise.h"

/**
 * \brief Exercise 2.3-5
 *        Implementation of the binary search algorithm asked in the exercise, in both iterative and recursive form.
 */
class Exercise_2_3_5 : public Exercise
{
    public:
        Exercise_2_3_5();
        virtual ~Exercise_2_3_5();

    public:
        static int findIntInTableRecursive(int _iToFind, int* _aiTable, int _iSize); //used in exercise 2.3-7

    private:
        virtual void implementation();
        int findIntInTableIterative(int _iToFind, int* _aiTable, int _iSize);
};

#endif /* EXERCISE_2_3_5_H_ */
